import api from "@/util/api";

const orderApi = {
  findAll(pageNum, size, params = {}) {
    console.log("orderApi.findAll", pageNum, size, params);
    return api
      .get("/order", {
        //发送请求
        params: {
          pageNum,
          size,
          ...params,
        },
      })
      .then((resp) => resp.data);
  },
  removeAll(ids) {
    return api.delete("/order", { data: ids }).then((resp) => resp.data);
  },
  save(order) {
    return api.post("/order", order).then((resp) => resp.data);
  },
  update(order) {
    return api.put("/order", order).then((resp) => resp.data);
  },
  findById(id) {
    return api.get("/order/" + id).then((resp) => resp.data);
  },
};

export default orderApi;
